<!-- 商品详情 -->
<template>
    <div class="goods-desc">
        <h3 class="title">{{desc.title}}</h3>
        <hr>
        <div class="content" v-html="desc.content">
        </div>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                desc: {}
            }
        },
        created() {
            this.getdesc()
        },
        methods: {
            //获取商品详情数据
            async getdesc() {
                const {
                    data
                } = await this.$http.get('api/goods/getdesc/' + this.id)
                if (data.status === 0) this.desc = data.message[0]
            }
        },
        props: ['id']
    }
</script>
<style lang="scss">
    .goods-desc {
        padding: 5px;
        h3 {
            font-size: 15px;
            text-align: center;
            line-height: 35px;
        }
        .content {
            img {
                width: 100%;
            }
        }
    }
</style>